<template>
  <div class="person-info-container">
    <div class="title rounded-lg">
      <p>个人设置</p>
    </div>
    <div class="info-container rounded-lg">
      <div class="info-menu-box">
        <ul>
          <li v-for="(item, index) in infoMeunList" :key="index" @click="toType(index)"
            :class="{ active: infoMeun == index }">
            <router-link :to="infoMeunLink[index]">{{ item }}</router-link>

          </li>
        </ul>
      </div>
      <div class="safes-box">
        <router-view />
      </div>
    </div>
  </div>

</template>

<script>
import mineBasic from '@/components/MineBasic.vue'
import mineSafe from '@/components/MineSafes.vue'
export default {
  name: '',
  components: {
    mineSafe,
    mineBasic
  },
  data() {

    return {
      infoMeunList: [
        '基本资料', "安全资料", "地址管理"
      ],
      infoMeunLink: [
        'basic', 'safe', 'address'
      ],
      infoMeun: 0,

    }
  },
  methods: {
    toType(index) {
      this.infoMeun = index
    }
  },

  mounted() {

  },
  computed: {

  },
  methods: {
    toType(index) {
      this.infoMeun = index
    }
  },
  created() {
      if (this.$route.path !== "/mine/setting/basic"){
        console.log(this.$route.path)
        this.$router.replace("basic")

      }
    }


}

</script>
<style  lang="less" scoped>
.person-info-container {
  width: 100%;
  max-width: 1200px;
  padding-left: 30px;

  .title {
    height: 60px;
    background: #fff;
    line-height: 60px;
    text-align: left;
    padding-left: 20px;
    box-shadow: 0 2px 16px 0 hsl(0deg 0% 71% / 40%);
  }

  .info-container {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff;


    .info-menu-box {
      // margin-top: 40px;
      width: 100%;
      border-bottom: 1px solid rgba(128, 128, 128, 0.501);

      ul {
        display: flex;
        height: 40px;
        align-items: center;

        li {
          list-style: none;
          color: rgba(128, 128, 128, 0.511);
          width: 70px;
          font-size: 14px;
          border-right: 1.5px solid rgba(128, 128, 128, 0.5);
          cursor: pointer;

          a {
            font-size: 14px;
            width: 100%;
            display: block;
          }

          .router-link-active {

            @apply text-gray-500;
            width: 100%;
            height: 100%;
          }
        }

        li.active {
          color: rgb(72, 70, 70);
        }
      }
    }

    .safes-box {

      // display: none;
      // height: 200px;
      .basicinfo-container {
        // display: none;


        .box {
          width: 100%;
          padding-left: 20px;
          padding-top: 20px;
          padding-right: 20px;
          // background: pink;
          text-align: left;
          box-sizing: border-box;

          span {
            color: rgba(128, 128, 128, 0.8);
          }

          .info-input {
            padding-top: 10px;
            width: 100%;

            input {
              width: 100%;
              outline: none;
              height: 30px;
              padding-left: 10px;
              border: 1px solid rgba(128, 128, 128, 0.5);
              border-radius: 5px;
            }

            input:focus {
              border: 1px solid #2469e5;
            }

            textarea {
              width: 100%;
              outline: none;
              height: 50px;
              padding-top: 10px;
              padding-left: 10px;
              border: 1px solid rgba(128, 128, 128, 0.5);
              border-radius: 5px;
              font-size: 18px;
              resize: vertical;
            }

            textarea:focus {
              border: 1px solid #2469e5;
            }
          }

        }

        .sumbit-button {
          height: 70px;
          text-align: right;
          padding-right: 20px;
          box-sizing: border-box;

          button {
            position: relative;
            top: 10px;
            width: 100px;
            height: 40px;
            border: none;
            border-radius: 5px;
            background: #2469e560;
            color: #fff;
            cursor: pointer;
          }
        }
      }

      .safeinfo-container {
        display: block;

        .li {

          width: 100%;
          min-height: 40px;
          border-bottom: 1px solid rgba(128, 128, 128, 0.5);
          // display: flex;
          padding-top: 20px;
          padding-bottom: 0px;

        }

        .real-name {
          position: relative;
          flex-shrink: 0;
          width: 100%;


          .name-state {
            width: 100%;
            display: flex;
            align-items: center;
            // justify-content: center;
            justify-content: space-between;

            .state {
              text-align: left;
              // width: 80%;
              padding-left: 15px;
              box-sizing: border-box;

              .statespan {
                font-size: 10px;
                padding: 3px;
                background: rgba(255, 0, 0, 0.3);
                border: 1px solid red;
              }

              .statespan.active {
                background: #2469e550;
                border: 1px solid #2469e5;
              }

            }

            .set {
              width: auto;
              color: #2469e5;
              cursor: pointer;
            }

            .name {
              color: rgba(255, 0, 0, 0.6);
            }

            .name.active {
              cursor: default;
              color: rgba(128, 128, 128, 0.5);
            }
          }

          .el-dialog__wrapper {
            /deep/ .el-dialog {
              width: 400px;

              .el-form-item {
                text-align: left;

                span {
                  // text-align: left;
                }


              }

              .el-input__icon {
                width: auto;
              }
            }
          }

          .dialog-footer {
            .el-button {
              color: black;
            }

            .el-button:hover {
              background: #409EFF;
            }
          }
        }
      }
    }
  }
}
</style>
